package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.aliyuncs.exceptions.ClientException;
import com.itheima.constant.MessageConstant;
import com.itheima.constant.RedisMessageConstant;
import com.itheima.entity.Result;
import com.itheima.service.ValidateCodeService;
import com.itheima.util.SMSUtils;
import com.itheima.util.ValidateCodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.JedisPool;

/**
 * @author hql
 * @date 2019-12-08 9:40
 */
@RestController
@RequestMapping("/validateCode")
public class ValidateCodeController {
    @Reference
    private ValidateCodeService validateCodeService;

    @RequestMapping("/sendCode")
    public Result sendCode(String telephone) {
      return  validateCodeService.sendCode(telephone);
    }

    @RequestMapping("/send4Code")
    public Result send4Login(String telephone) {
        return validateCodeService.send4Login(telephone);
    }
}
